<!doctype html>
<uieip type="page" value="base"></uieip>
<uieip type="reg" value="console,cms"></uieip>

<html>

<head>
    <uieip type="file" value="inc" src="/cms/inc/pc_head_inc.html"></uieip>
    <uieip type="tmpl" value="cms.title"></uieip>
</head>

<body>
    <div class="container py-3">
        <uieip type="file" value="exec" src="/cms/inc/pc_topmenu_exec.html"></uieip>
        <uieip type="file" value="exec" src="/cms/inc/pc_breadcrumb_exec.html"></uieip>
        <div class="row">
            <div class="col-md-8 col-sm-7">
                <uieip id="div_row" type="tmpl" value="cms.datarow" dbname="yqbase" tbname="cms_news" seek="tid='{id}'"
                    order="time desc" js="datarow_js"></uieip>
            </div>
            <div class="col-md-4 col-sm-5">
                <div class="listright">
                    <uieip id="div_list" type="tmpl" value="cms.datalist" dbname="yqbase" tbname="cms_news" pageno="1"
                        pagesize="5" where="" order="time desc" js="datalist_js"></uieip>
                </div>
            </div>
        </div>
    </div>
    <uieip type="file" value="inc" src="/cms/inc/pc_footer_inc.html"></uieip>
    <script runat="server">
        function datalist_js(data) {
            var t_url = "/" + data.path + "/";
            var h_ = `<h4 class="listtitle">推荐<a href="` + t_url + `" class="pull-right">more</a></h4>`;
            h_ += `<div class="list-group">`;
            for (var i = 0; i < data.rows.length; i++) {
                h_ += `   <a href="` + data.rows[i].tid + `.html" class="list-group-item list-group-item-action">`;

                h_ += '      <div class="media">';
                h_ += '       <div class="media-body">';
                h_ += '          <h4 class="media-heading">' + data.rows[i].title;
                h_ += '           <small class="pull-right" style="padding-top: 5px;">' + data.rows[i].time.substring(0, data.rows[i].time.indexOf(" ")) + '</small>';
                h_ += '        </h4>';
                h_ += '        </div>';
                h_ += '      </div>';

                h_ += `   </a>`;
            }
            h_ += `</div>`;
            return h_;
        }


        function datarow_js(data) {
            //response.write(JSON.stringify(data));
            if (data.row) {
                var h_ = '<div class="article jumbotron">';

                h_ += ' <h2 class="title">' + data.row.title + '</h2>';
                h_ += ' <h3 class="time">' + data.row.time.split(" ")[0] + '</h3>';
                h_ += JSON.parse(data.row.body).html;
                h_ += ' <div class="page">';
                if (data.prev) {
                    h_ += `		<a href="` + data.prev.tid + `.html">前一条：` + data.prev.title + `</a>`
                }
                if (data.next) {
                    h_ += `		<a href="` + data.next.tid + `.html" class="pull-right">下一条：` + data.next.title + `</a>`
                }
                h_ += ' </div>';
                h_ += '</div>';
                return h_;
            } else {
                return "";
            }
        }
    </script>
    <script>
        $(function () {
            $(window).resize(function () {
                onresize();
            });
            onresize();
        });
        function onresize() {
            $(".inner-info").css({ "margin-bottom": "0px" });
            var $foot_ = $(".footer .container");
            var h_ = parseInt($(document).height() - ($foot_.offset().top + $foot_.height()));

            if (h_ > 0) {
                $(".footer").prev().css({ "margin-bottom": h_ + "px" });
            }
        }
    </script>
</body>

</html>
